package cn.com.surker.report.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 生产分析
 * </p>
 *
 * @author admin
 * @since 2022-09-14
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class ReportProduction implements Serializable {

    private static final long serialVersionUID = 1L;


    /**
     * 标识
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 类型描述
     */
    private String name;

    /**
     * 统计日期(格式yyyy-MM-dd)
     */
    private String today;

    /**
     * 类型(0:日1:月2:年)
     */
    private Integer type;

    /**
     * 数据源Code
     */
    private String code;

    /**
     * 公司ID
     */
    private Long orgId;

    /**
     * 公司名称
     */
    private String orgName;

    /**
     * 计划量
     */
    private Double planStere;

    /**
     * 生产量
     */
    private Double proStere;

    /**
     * 泵送方量
     */
    private Double pumpStere;

	public Double getPumpStere() {
		if(pumpStere == null){
			return 0d;
		}
		return pumpStere;
	}

	/**
     * 砂浆量
     */
    private Double mortarStere;

    /**
     * 报废量
     */
    private Double scrapStere;

    /**
     * 签收量
     */
    private Double signStere;

    /**
     * 运输车辆
     */
    private Integer trainCar;

    /**
     * 空闲车辆
     */
    private Integer freeCar;

    /**
     * 累计运距
     */
    private Double distance;

    /**
     * 泵车
     */
    private Integer pumpCar;

    /**
     * 驾驶员
     */
    private Integer driverNum;

    /**
     * 车次
     */
    private Integer trainNo;

    /**
     * 机楼使用时间
     */
    private Integer lineTime;

    /**
     * 机楼总数
     */
    private Integer lineTotal;

    /**
     * 机楼使用率
     */
    private Double lineRate;

    /**
     * 订单来源占比(JSON数据)
     */
    private String orderRate;

    /**
     * 状态(0:启用1:禁用)
     */
    private Integer status;

    /**
     * 机楼使用率分析
     */
    private String lineRateData;

    /**
     * 手机订单方量
     */
    private Double orderStere;

    /**
     * 生产分析
     */
    private String productionData;

    /**
     * 泵送分析
     */
    private String pumpData;

    /**
     * 车辆使用分析
     */
    private String carData;

    /**
     * 供应工程
     */
    private Integer supplyBuild;

    /**
     * 供应订单
     */
    private Integer supplyOrder;

    /**
     * 供应订单
     */
    private Integer smartOrder;

    /**
     * 同比订单
     */
    private Integer yoyOrder;
    /**
     * 环比订单
     */
    private Integer qoqOrder;

    /**
     * 机楼产能利用率
     */
    private Double lineCapacity;

    /**
     * 计划完成率
     */
    private Double planRate;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date createTime;

    /**
     * 更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date updateTime;


    public ReportProduction () {

    }

    public ReportProduction(String name, String today, Integer type, String code, Long orgId, String orgName,
                            Double planStere, Double proStere, Double pumpStere, Double mortarStere,
                            Double scrapStere, Double signStere, Integer trainCar, Integer freeCar, Double distance,
                            Integer pumpCar, Integer driverNum, Integer trainNo, Integer lineTime, Integer lineTotal,
                            Double lineRate, String orderRate, Integer status, String lineRateData, String productionData,
                            String pumpData, String carData, Double orderStere, Date createTime, Date updateTime,
                            Integer supplyBuild, Integer supplyOrder, Double lineCapacity, Double planRate,
                            Integer smartOrder, Integer yoyOrder, Integer qoqOrder) {
        this.name = name;
        this.today = today;
        this.type = type;
        this.code = code;
        this.orgId = orgId;
        this.orgName = orgName;
        this.planStere = planStere;
        this.proStere = proStere;
        this.pumpStere = pumpStere;
        this.mortarStere = mortarStere;
        this.scrapStere = scrapStere;
        this.signStere = signStere;
        this.trainCar = trainCar;
        this.freeCar = freeCar;
        this.distance = distance;
        this.pumpCar = pumpCar;
        this.driverNum = driverNum;
        this.trainNo = trainNo;
        this.lineTime = lineTime;
        this.lineTotal = lineTotal;
        this.lineRate = lineRate;
        this.orderRate = orderRate;
        this.status = status;
        this.lineRateData = lineRateData;
        this.productionData = productionData;
        this.pumpData = pumpData;
        this.carData = carData;
        this.createTime = createTime;
        this.updateTime = updateTime;
        this.orderStere = orderStere;
        this.supplyBuild = supplyBuild;
        this.supplyOrder = supplyOrder;
        this.lineCapacity = lineCapacity;
        this.planRate = planRate;
        this.smartOrder = smartOrder;
        this.yoyOrder = yoyOrder;
        this.qoqOrder = qoqOrder;
    }

}
